import 'dart:convert';

import 'package:http/http.dart' as http;

import '../bean/home_model_bean.dart';
import 'package:dio/dio.dart';


var HOME_URL = Uri.parse('https://www.devio.org/io/flutter_app/json/home_page.json');

class HomeDao{
  static Future<HomeBean> fetch() async{
    final response =await http.get(HOME_URL);
    Utf8Decoder utf8decoder=const Utf8Decoder();
    //解码 转换
    final result=json.decode(utf8decoder.convert(response.bodyBytes));
    return HomeBean.fromJson(result);
  }
}
